<?php /*a:1:{s:87:"/Users/juyaobin/Desktop/Site/app/useradmin/view/SiteSetting/Site/ApiExtendsSetting.html";i:1615816835;}*/ ?>
<!--
 * @Date: 2021-03-12 21:20:30
 * @名称: 
 * @版本: 0.01
 * @作者: 初雪桜
 * @邮箱: 202184199@qq.com
 * @最后编辑: 初雪桜
 * @LastEditTime: 2021-03-15 22:00:35
 * @FilePath: /Site/app/useradmin/view/SiteSetting/Site/ApiExtendsSetting.html
-->
<html>

<head>
    <meta charset="UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>网站后台管理模版</title>
    <script src="/public/static/admin/imgupdate/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/admin/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/css/admin.css" />
    <script src="/public/static/other.js"></script>
    <script src="/public/static/tisp.js"></script>
    <style>
        .layui-form-label {
            width: 120;
        }
    </style>
</head>

<body>
    <div class="page-content-wrap">
        <form class="layui-form">
            <div class="layui-tab" style="margin: 0">

                <div class="layui-tab-content">
                    <div class="layui-form-item layui-form-text">
                        <label title="自加密解析密钥不可为空 可逆" class="layui-form-label">令牌解析 - key authcode：</label>
                        <div class="layui-input-block">

                            <div style="display: flex;" class="layui-box layui-upload-button">

                                <div style="width: 100%;">
                                    <input type="text" id="token-parser-authcode" lay-verify="required"
                                        placeholder="自加密解析密钥不可为空 可逆" autocomplete="off" class="layui-input"
                                        value="<?php echo htmlentities($TokenResolutionKey); ?>" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label title="Sha512加密密钥不可为空 不可逆" class="layui-form-label">令牌解析 - key Sha512：</label>
                        <div class="layui-input-block">

                            <div style="display: flex;" class="layui-box layui-upload-button">

                                <div style="width: 100%;">
                                    <input type="text" id="token-parser-sha512" lay-verify="required"
                                        placeholder="Sha512加密密钥不可为空 不可逆" autocomplete="off"
                                        class="layui-input" value="<?php echo htmlentities($TokenResolutionKeySha512); ?>" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label title="Sha512加密密钥不可为空 不可逆" class="layui-form-label">Url 验证 - key Sha512：</label>
                        <div class="layui-input-block">

                            <div style="display: flex;" class="layui-box layui-upload-button">

                                <div style="width: 100%;">
                                    <input type="text" id="url-verification-sha512" lay-verify="required"
                                        placeholder="Sha512加密密钥不可为空 不可逆" autocomplete="off"
                                        class="layui-input" value="<?php echo htmlentities($UrlResolutionKeySha512); ?>" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否启用超时 - time out：</label>

                        <div class="layui-input-block">

                            <div id="if-time-out" style="display: flex;" class="layui-box layui-upload-button">
                                <?php if($OpenOrNotRequestTimeOut == true): ?>
                                <!-- 判断是不是开启了时间超时验证 -->
                                <input type="checkbox" id="if-time-out-input" checked="" lay-skin="switch"
                                    lay-filter="switchTest" lay-text="ON|OFF">
                                <div class="layui-unselect layui-form-switch" lay-skin="_switch"><em></em><i></i>
                                </div>
                                <?php else: ?>
                                <input type="checkbox" id="if-time-out-input" lay-skin="switch" lay-filter="switchTest"
                                    lay-text="ON|OFF">
                                <div class="layui-unselect layui-form-switch" lay-skin="_switch"><em></em><i></i>
                                </div>
                                <?php endif; ?>
                                <div>
                                    <div style="left: 10px;" class="layui-inline">
                                        <input type="text" id="time-out-value" lay-verify="required" placeholder="超时时间"
                                            autocomplete="off" class="layui-input NumDecText"
                                            value="<?php echo htmlentities($RequestTimeOut); ?>" />
                                    </div>

                                    <div style="left: 10px;" class="layui-inline">
                                        <div class="layui-unselect layui-form-radio layui-form-radioed"><span>秒</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">

                    </div>

                </div>
            </div>
            <div class="layui-form-item" style="padding-left: 10px">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="formDemo">
                        立即提交
                    </button>

                </div>
            </div>
        </form>
    </div>
    <script src="/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/admin/js/common.js" type="text/javascript" charset="utf-8"></script>
    <script>

        $(".NumDecText").keyup(function () {
            $(this).val($(this).val().replace(/[^0-9.]/g, ''));
        }).bind("paste", function () {  //CTR+V事件处理    
            $(this).val($(this).val().replace(/[^0-9.]/g, ''));
        }).css("ime-mode", "disabled"); //CSS设置输入法不可用    


        $(".layui-btn-normal").click(function (e) {
            $tokenParserAuthcode = ($("#token-parser-authcode").val());//令牌解析 - key authcode
            $tokenParserSha512 = ($("#token-parser-sha512").val());//令牌解析 - key Sha512
            $urlVerificationSha512 = ($("#url-verification-sha512").val());//Url 验证 - key Sha512
            $ifTimeOutInput = ($("#if-time-out-input").is(':checked'));//是否启用超时
            $timeOutValue = ($("#time-out-value").val());//超时时间
            requestData(
                "/<?php echo htmlentities($useradmin); ?>/Setting/SiteSetting/SaveApiExtendsSetting", {
                "tokenParserAuthcode": $tokenParserAuthcode,
                "tokenParserSha512": $tokenParserSha512,
                "urlVerificationSha512": $urlVerificationSha512,
                "ifTimeOutInput": $ifTimeOutInput,
                "timeOutValue": $timeOutValue,
            },
                (e) => {
                    if (e.code == 200) {
                        alert('aaaa')
                    } else {
                        ErrorTips(e.code, e.message, e.detail, () => {
                            window.location.reload()
                        });
                    }
                    layer.close(loginTips);
                }
            );
        })
    </script>
    <iframe id="layui-upload-iframe" class="layui-upload-iframe" name="layui-upload-iframe"></iframe>
</body>

</html>